package com.mdd.common.entity.wxpay;

import com.github.binarywang.wxpay.config.WxPayConfig;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;


@Data
@NoArgsConstructor
@ApiModel(value = "微信配置返回对象",description = "微信配置返回对象")
public class SystemWxPayConfig implements Serializable {

    private static final long serialVersionUID = -1L;
    /**
     * 位置支付接口版本
     */
    @ApiModelProperty(value = "位置支付接口版本 v3")
    private String interfaceVersion;

    @ApiModelProperty("app id")
    private String appId;

    /**
     * 微信支付商户号
     */
    @ApiModelProperty(value = "微信支付商户号")
    private String mchId;

    @ApiModelProperty(value = "商户类型 1 普通商户")
    private String merchantType;

    /**
     * 商户API v3密钥
     */
    @ApiModelProperty(value = "商户API V3密钥")
    private String payV3SignKey;

    @ApiModelProperty(value = "证书序列号")
    private String mchSerialNo;

    @ApiModelProperty(value = "微信支付证书密钥")
    private String apiclientKey;

    /**
     * 商户API密钥
     */
    @ApiModelProperty(value = "商户API密钥")
    private String paySignKey;

    @ApiModelProperty(value = "微信支付证书")
    private String apiclientCert;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SystemWxPayConfig)) return false;
        SystemWxPayConfig that = (SystemWxPayConfig) o;
        return appId.equals(that.appId) && mchId.equals(that.mchId) && payV3SignKey.equals(that.payV3SignKey) && mchSerialNo.equals(that.mchSerialNo) && apiclientKey.equals(that.apiclientKey) && paySignKey.equals(that.paySignKey);
    }

    @Override
    public int hashCode() {
        return Objects.hash(appId, mchId, payV3SignKey, mchSerialNo, apiclientKey, paySignKey);
    }
}